#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket
import time
from threading import Thread, current_thread

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("127.0.0.1", 8080))

def talk():
    print("start")
    while True:
        msg = "{} hello world".format(current_thread().name)
        client.send(msg.encode("utf-8"))
        data = client.recv(1024).decode("utf-8")
        print(data)

if __name__ == '__main__':
    for i in range(100):
        t = Thread(target=talk)
        t.start()
